class Solution:
    def countNumbersWithUniqueDigits(self, n: int) -> int:
        if not n:
            return 1
        res, di = 10, 9
        for i in range(1, n):
            di *= 10 - i
            res += di
        return res


a = Solution()
print(a.countNumbersWithUniqueDigits(1))
print(a.countNumbersWithUniqueDigits(2))
print(a.countNumbersWithUniqueDigits(3))
print(a.countNumbersWithUniqueDigits(4))
print(a.countNumbersWithUniqueDigits(5))
print(a.countNumbersWithUniqueDigits(10))
print(a.countNumbersWithUniqueDigits(11))
